-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Make TimedeltaIndex +/- pd.NaT return TimedeltaIndex #19139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Travis http error |
@@ -302,14 +302,14 @@ def test_nat_arithmetic_index(): | |||
tm.assert_index_equal(left - right, exp) | |||
tm.assert_index_equal(right - left, exp) | |||
|
|||
# timedelta | |||
# timedelta # GH#19124 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add similar testing for Series here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot this surfaces a new bug; I'll xfail for now.
pandas/tests/scalar/test_nat.py
Outdated
tm.assert_index_equal(NaT - tdi, tdi_nat) | ||
|
||
|
||
@pytest.mark.xfail(reason='NaT - Series returns NaT. This behavior was ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just parametrize around tdi and Series, too much repeated code (you can xfail that case using pytest.param)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls do this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are pinging but not doing what I ask.
you need to rebase |
Looks like Travis is timing out in a bunch of places. Will hold off on pushing for now. Once this gets in I've got a patch ready for #19158 that will un-xfail that one test. |
Codecov Report
@@ Coverage Diff @@
## master #19139 +/- ##
==========================================
- Coverage 91.52% 91.52% -0.01%
==========================================
Files 147 147
Lines 48827 48795 -32
==========================================
- Hits 44691 44661 -30
+ Misses 4136 4134 -2
Continue to review full report at Codecov.
|
ping. Once this goes in I can fix the bug that surfaced in |
pandas/tests/scalar/test_nat.py
Outdated
tm.assert_index_equal(NaT - tdi, tdi_nat) | ||
|
||
|
||
@pytest.mark.xfail(reason='NaT - Series returns NaT. This behavior was ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls do this here.
Just tried this and pytest is raising errors at collect-time, complaining about pytest.param. This would be a non-issue if weren't for the xfail. After this branch is merged I've got a branch ready that fixes the xfailing error. Since that PR will have to change this test anyway, let's parametrize it in that PR. |
ping |
pandas/tests/scalar/test_nat.py
Outdated
tm.assert_index_equal(NaT - tdi, tdi_nat) | ||
|
||
|
||
@pytest.mark.xfail(reason='NaT - Series returns NaT. This behavior was ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are pinging but not doing what I ask.
Please read my previous comment. |
I read your comment. its doesn't make any sense. |
Then ask for clarification, buddy. Just repeating the request without acknowledging that I tried to implement and discuss it is pretty discouraging. Implementing the parameterization you're asking for looks like this:
(Even if it didn't cause an error, this is 5 lines of boilerplate to eliminate a 6 line test.)
So the options here are:
|
pass as args not a tuple. I agree its a little bit odd that pytest doesn't accept a tuple here, and I know that this is adding an xfail that you are going to remove later, but would rather do that than miss adding the tests with coverage. |
Not sure what you mean here.
The xfail and the coverage exist in the PR-as-is. If you can clarify the "args not a tuple" thing I'll try to implement it, since that is a faster way of getting bugs fixed than arguing about it. But compromising with me on this is an even faster way to get even more bugs fixed, and it ends with the same parametrized tests you have in mind. |
do this
not this
|
thank you for fixing! |
git diff upstream/master -u -- "*.py" | flake8 --diff